package com.rfid.assistant;

import android.app.Application;

import com.rfid.assistant.bean.DaoMaster;
import com.rfid.assistant.bean.DaoSession;

import org.greenrobot.greendao.database.Database;

public class App extends Application {

    private DaoSession mDaoSession;
    private static App mApp;
    @Override
    public void onCreate() {
        super.onCreate();
        mApp = this;
        DaoMaster.OpenHelper openHelper = new DaoMaster.DevOpenHelper(this,"assistant.db");
        Database database = openHelper.getWritableDb();
        mDaoSession = new DaoMaster(database).newSession();
    }

    public static App getInstance() {
        return mApp;
    }

    public DaoSession getDaoSession() {
        return mDaoSession;
    }
}
